package com.day20.MyThread;
public class MyThread extends Thread {
    public MyThread() {}
    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(this.getName() + "正在运行");
        }
    }
}

class MyThreadDemo {
    public static void main(String[] args) {
        MyThread t1 = new MyThread("高铁");
        MyThread t2 = new MyThread("飞机");
        t1.start();
        t2.start();
        System.out.println(Thread.currentThread().getName());
    }
}
